window.addEventListener('load', function () {
    //充值滑动
    let recharge_tabs = document.querySelector('.conve-tabs').getElementsByTagName('a')
    let recharge_body = document.querySelector('.recharge-tab-body')
    let prev = 0
    for (let i = 0; i < recharge_tabs.length; i++) {
        recharge_tabs[i].addEventListener('mouseenter', function () {
            if (i != prev) {
                for (let i = 0; i < recharge_tabs.length; i++) {
                    recharge_tabs[i].classList.remove('current1')
                }
                prev = i
            }
            this.classList.add('current1')
            animate(recharge_body, -i * 300)

        })

    }
    //旅游滑动
    let tabs1s = document.querySelector(".tabs1").getElementsByTagName('a')
    let trip_body = document.querySelector('.body1')
    let prev1 = 0
    for(let i = 0; i < tabs1s.length;i++){
        tabs1s[i].addEventListener('mouseenter',function(){
            if (i != prev1) {
                for (let i = 0; i < tabs1s.length; i++) {
                    tabs1s[i].classList.remove('current1')
                }
                prev1 = i
            }
            this.classList.add('current1')
            animate(trip_body, -i * 300)
        })
    }
    //保险滑动
    let tabs2s = document.querySelector(".tabs2").getElementsByTagName('a')
    let baoxian_body = document.querySelector('.body2')
    let prev2 = 0
    for(let i = 0; i < tabs2s.length;i++){
        tabs2s[i].addEventListener('mouseenter',function(){
            if (i != prev2) {
                for (let i = 0; i < tabs2s.length; i++) {
                    tabs2s[i].classList.remove('current1')
                }
                prev2 = i
            }
            this.classList.add('current1')
            animate(baoxian_body, -i * 300)
        })
    }
    //改变图标颜色
    let conve_combox = document.querySelectorAll('.conve-combox')
    let conve_icon_phone = document.querySelector('.conve-icon-phone')
    conve_combox[0].addEventListener('mouseover', function () {
        conve_icon_phone.style.backgroundPosition = '-4px 3px'
    })
    conve_icon_phone.addEventListener('mouseover', function () {
        this.style.backgroundPosition = '-4px 3px'
    })
    conve_combox[0].addEventListener('mouseout', function () {
        conve_icon_phone.style.backgroundPosition = '-24px 3px'
    })
    conve_icon_phone.addEventListener('mouseout', function () {
        this.style.backgroundPosition = '-24px 3px'
    })
    let conve_arrows = document.querySelector(".conve-icon-arrows")
    conve_combox[1].addEventListener('mouseover', function () {
        conve_arrows.style.backgroundPosition = '-4px -22px'
    })
    conve_arrows.addEventListener('mouseover', function () {
        this.style.backgroundPosition = '-4px -22px'
    })
    conve_combox[1].addEventListener('mouseout', function () {
        conve_arrows.style.backgroundPosition = '-24px -22px'
    })
    conve_arrows.addEventListener('mouseout', function () {
        this.style.backgroundPosition = '-24px -22px'
    })
    //点击显示电话记录
    let phone_number_log = document.querySelector('#tbr-phone-number-log')
    let box_bd = document.querySelector('.conve-bd-box')
   
    conve_icon_phone.addEventListener('click', function (e) {
        phone_number_log.style.display = 'inline-block'
        e.stopPropagation()
    })
   
    //点击关闭电话记录
    box_bd.addEventListener("click", function () {
        phone_number_log.style.display = 'none'
    })
    //充值金额点击显示
    let money_box = document.querySelector(".money_box")
    conve_combox[1].addEventListener("click",function(e){
        money_box.style.display = "block"
        e.stopPropagation()
    })
    conve_arrows.addEventListener("click",function(e){
        money_box.style.display = "block"
        e.stopPropagation()
    })
    window.addEventListener('click',function(){
        money_box.style.display = "none"

    })




})